package com.ljy.tkmodel.controller;


import com.ljy.tkmodel.entity.Room;
import com.ljy.tkmodel.entity.vo.RoomConditionVo;
import com.ljy.tkmodel.service.RoomService;
import com.ljy.tkmodel.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/room")
public class RoomController {
    @Autowired
    RoomService roomService;

    @PostMapping("noXMLInsert")
    public int noXMLInsert(Room room) {
        return roomService.noXMLInsert(room);
    }

    @GetMapping("optimizeConditionQuery")
    public List<Room> optimizeConditionQuery(@RequestParam HashMap<String,Object> map){
        return roomService.optimizeConditionQuery(map);
    }

    @PostMapping("saveRoom")
    public boolean saveRoom(Room room){
        return  roomService.insertSql(room);
    }

    @PostMapping("SchoolCurriculum")
    public int SchoolCurriculum(RoomConditionVo roomConditionVo){
        return roomService.SchoolCurriculum(roomConditionVo);
    }
}

